* Make pooled dataset
version 12.1
use "for pooled.dta"	//if not present, run main code first

foreach var of newlist pop exp expsq mar tenure union outwis ind ieduc zerowage selfemp lwage {
qui gen `var'=.
}
foreach var of varlist pop exp expsq mar tenure union outwis ind ieduc zerowage selfemp lwage {
qui replace `var'=`var'74     
}

gen time="1"
la var time "Wave identifier"
tostring idpriv, gen(pooledid)
replace pooledid=time+pooledid
destring pooledid,replace
destring time,replace
la var pooledid "Unique ID in pooled set"
sort pooledid
keep idpriv pooledid time pop exp expsq mar tenure union outwis ind ieduc ///
lwage zbeautyf iqscore fathed mothed fathproex pinc57 farmbg ipop57 sibsnum  ///
fullhh momemployed  hssize milty ivocat female zerowage selfemp
save "p1.dta",replace

use "for pooled.dta"

foreach var of newlist pop exp expsq mar tenure union outwis ind ieduc zerowage selfemp lwage  {
qui gen `var'=.
}
foreach var of varlist pop exp expsq mar tenure union outwis ind ieduc zerowage selfemp lwage {
qui replace `var'=`var'92     
}

gen time="2"
tostring idpriv, gen(pooledid)
replace pooledid=time+pooledid
destring pooledid,replace
destring time,replace
sort pooledid
keep idpriv pooledid time pop exp expsq mar tenure union outwis ind ieduc ///
lwage zbeautyf iqscore fathed mothed fathproex pinc57 farmbg ipop57 sibsnum  ///
fullhh momemployed  hssize milty ivocat female zerowage selfemp

merge 1:1 pooledid using "p1.dta"
sort pooledid
drop _merge
save "pooled.dta",replace

log using "Scholz-Sicinski pooled.log", replace

regress lwage i.time##c.zbeautyf iqscore if female==0 & zerowage==0 & selfemp==0,cluster(idpriv)
estimates store poolediq

regress lwage i.time##c.zbeautyf iqscore fathed mothed fathproex pinc57 farmbg i.ipop57 sibsnum  ///
 fullhh momemployed  hssize milty pop exp expsq mar tenure union outwis i.ind i.ieduc ///
 ivocat  if female==0 & zerowage==0 & selfemp==0,cluster(idpriv)
estimates store pooledfs

log c
/*
#delimit ;
outreg2 [poolediq pooledfs] using "Pooled", word bdec(3) tdec(3) rdec(3) replace 
title(Table n, "Pooled Sample with Time Trend") 
addnote("Note 1. Standard errors clustered by person")  
drop (_Iind*)
label
sortvar(zbeautyf iqscore _Iieduc* ivocat exp* tenure mar outwis fathed mothed fathproex pinc57 farmbg _Iipop57*)
;
#delimit cr
*/





 



